package com.rc.saas.tenant.service.member;


import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.mapper.member.MemberInfoMapper;
import com.rc.saas.tenant.model.member.MemberInfo;
import com.rc.saas.tenant.model.member.MemberInfoExample;
import com.rc.saas.tenant.search.member.MemberSearch;
import com.rc.saas.tenant.vo.member.MemberInfoPrintVo;
import com.rc.saas.tenant.vo.member.MemberResultVo;

import java.text.ParseException;
import java.util.List;

public interface MemberInfoService extends BaseService<Long, MemberInfo, MemberInfoExample, MemberInfoMapper> {

    Long insertReturnId(MemberInfo memberInfo);

    void updateStatus(Long memberId);

    /**
     * 通过手机号查询会员
     */
    MemberInfo selectMemberByMobile(String tenantCode, String moblie);


    /**
     * 查询所有会员
     *
     * @return
     */
    long countAllMember(String tenantCode);

    long countTodayNewAdd(String tenantCode) throws ParseException;

    MemberInfo selectMemberByOpenid(String openId);

    MemberInfo selectMemberByUnionidTenantCode(String unionid, String tenantCode);

    List<MemberInfoPrintVo> exportMemberInfo(MemberSearch memberSearch);

    PageInfo<MemberResultVo> listPageMember(MemberSearch memberSearch);

    MemberResultVo selectMemberAndAccountByMobile(String tenantCode, String mobile);

    /**
     * 生成多个随机手机号码
     * @param tenantCode
     * @param memberNum
     * @return
     */
    String registerRandomMobile(String tenantCode,int memberNum);

    /**
     * 生成多个随机手机号码(返回会员id)
     * @param tenantCode
     * @return
     */
    TResponse registerMemberRetId(String tenantCode);

    MemberResultVo selectMemberById(Long memberId);
}
